import { request } from "@/utils/http";
import {
  ReqAddHospitalSetParams,
  ReqGetHospitalSetParams,
  ReqGetHospitalSetResponse,
} from "./types";

// 设置接口

// 请求获取医院设置的列表
export function reqGetHospitalSet(options: ReqGetHospitalSetParams) {
  // 结构赋值
  let { page, limit, hoscode, hosname } = options;
  return request.get<any, ReqGetHospitalSetResponse>(
    `/admin/hosp/hospitalSet/${page}/${limit}`,
    {
      params: {
        hoscode,
        hosname,
      },
    }
  );
}

// 请求新增医院设置
export function reqAddHospitalSet(data: ReqAddHospitalSetParams) {
  return request.post<any, null>("/admin/hosp/hospitalSet/save", data);
}
